﻿namespace Cordyceps.Elasticsearch.Tool.Exceptions;

/// <summary>
/// Elasticsearch操作异常
/// </summary>
public class ElasticsearchException : Exception
{
    /// <summary>
    /// 初始化新的Elasticsearch异常实例
    /// </summary>
    public ElasticsearchException()
    {
    }

    /// <summary>
    /// 初始化新的Elasticsearch异常实例
    /// </summary>
    /// <param name="message">异常消息</param>
    public ElasticsearchException(string message) : base(message)
    {
    }

    /// <summary>
    /// 初始化新的Elasticsearch异常实例
    /// </summary>
    /// <param name="message">异常消息</param>
    /// <param name="innerException">内部异常</param>
    public ElasticsearchException(string message, Exception innerException) : base(message, innerException)
    {
    }
    
    /// <summary>
    /// 操作类型
    /// </summary>
    public string? Operation { get; set; }
    
    /// <summary>
    /// 索引名称
    /// </summary>
    public string? IndexName { get; set; }
    
    /// <summary>
    /// 文档ID
    /// </summary>
    public string? DocumentId { get; set; }
}